<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>

<input type="hidden" id="if_have_org" name="proposal/if_have_org">
<div class="t_bar"><span class="color_red">*</span>项目基本情况</div>
	<table class="t_css" width="100%" id="basic_info_jzfp" border="0" cellpadding="0"
	    cellspacing="1">
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	<col style="width: 25%"/>
	    <tr class="li_1">
	        <td align="right">项目名称：</td>
	        <td colspan="3">
	        	<input type='text' name='proposal/zh_title' id='zh_title' style="width: 80%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="项目名称">
	        </td>
	    </tr>
	    <tr >
	        <td align="right">归口管理部门：</td>
	        <td colspan="3">
	        	<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
				<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理部门"
         			id="recomend_org"  showPattern="all" shieldPattern="0" topCheckbox="false" onClick="initTreeValueExt" />
				<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
				<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
	        <%-- <span name="proposal/recomend_org_gk_name">
 					<x:out select="$xmlData/data/proposal/recomend_org_name"/>
 				</span> --%>
	        </td>
	    </tr>
	    <%-- <tr >
	        <td align="right">所属领域： </td>
	        <td colspan="3">
				<c:set var="sub_type"><x:out select="$xmlData/data/proposal/sub_type" /></c:set>
				<cpt:checkbox key="domain_hmgc" name="proposal/sub_type"  value="${sub_type }" width="70px;" repeatColumn="3"  style="border: 0px; padding: 0px; margin: 0px;float:left;"  ></cpt:checkbox>
				<input type="hidden" id="sub_type_value" name="proposal/sub_type_value"  class="required"  value="<x:out select="$xmlData/data/proposal/sub_type_value" />" label="所属领域">
				<input type="hidden" name="proposal/sub_type_name" value="<x:out select="$xmlData/data/proposal/sub_type_name" />">
			</td>
	    </tr> --%>
	    <tr>
	    	<td align="right">项目联系人姓名：</td>
	    	<td>
	    		<input  type="text" label="项目联系人姓名" name="proposal/contact_psn_cname" class="input_css required" maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
	    		<%-- <span name="proposal/contact_psn_cname"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_name"/>
		    	</span> --%>
	    	</td>
	    	<td align="right">联系人手机：</td>
	    	<td>
	    		<input type="text" label="联系人手机" name="proposal/contact_psn_mobile" class="input_css required mobile" maxlength="11" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
	    		<%-- <span name="proposal/contact_psn_mobile"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_mobile" /> 
		    	</span> --%>
	    	</td>
	    </tr>
	    <%--  <tr>
	    	<td align="right">职称：</td>
	    	<td>
	    		<span name="proposal/contact_prof_title_name"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_prof_title_name"/>
		    	</span>
	    	</td>
	    	<td align="right">职务：</td>
	    	<td>
	    		<span name="proposal/contact_position"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_position" /> 
		    	</span>
	    	</td>
	    </tr>
	     <tr>
	    	<td align="right">办公电话：</td>
	    	<td>
		    	<span name="proposal/contact_tel"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_tel"/>
		    	</span>
	    	</td>
	    	<td align="right">电子邮箱：</td>
	    	<td>
	    		<span name="proposal/contact_email"> 
			    	<x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_email" /> 
		    	</span>
	    	</td>
	    </tr> --%>
	    
	    
	    <%-- <tr>
	    	<td align="right">传真：</td>
	    	<td>
	    		<span name="proposal/contact_fax"> 
			    	<x:out select="$xmlData/data/organization/contact_info/contact_fax" /> 
		    	</span>
	    	</td>
	    	
	    </tr> --%>
	    <tr>
	    	<td align="right">项目开始时间：</td>
	    	<td>
		    	<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date"/></c:set>
				<cpt:date id="start_date" name="proposal/start_date" label="项目开始时间" value="${start_date }" className=" required  date  "  size="15" ></cpt:date>
	    	</td>
	    	<td align="right">项目结束时间：</td>
	    	<td>
		    	<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date"/></c:set>
				<cpt:date id="end_date" name="proposal/end_date" label="项目结束时间" value="${end_date }" className=" required  date dateCompareAfterE:end_date:start_date "  size="15" ></cpt:date>
	    	</td>
	    </tr>
	    <tr>
	    	<td align="right">项目报审级次：<br/>（省补助资金拨付所属财政局）</td>
	        <td >
				<c:set var="sub_step">{'id':'<x:out select="$xmlData/data/proposal/sub_step_value" />','name':'<x:out select="$xmlData/data/proposal/sub_step_name" />'}</c:set>
	          	<cpt:tree key="sub_step" cacheable="false" className="hn_iuput_kuang  " readonly="true" value="${sub_step}"  label="项目报审级次" 
	          		id="sub_step" onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
		        <input id="sub_step_value" type="hidden" name="proposal/sub_step_value" class="required" label="项目报审级次" value="<x:out select="$xmlData/data/proposal/sub_step_value" />"/>
	            <input id="sub_step_name" type="hidden" name="proposal/sub_step_name"  value="<x:out select="$xmlData/data/proposal/sub_step_name" />"/>
			</td>
			<td align="right">项目申请金额（万元）：</td>
	    	<td>
	    		<input type='text' name='proposal/request_money' class="required" id='request_money' onfocus="InitInput.setNumber(this,9,4,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/request_money"/>' label="项目申请金额">
	    	</td>
	    </tr>
	    <%-- <tr>
	    	<td>主要目标主要任务考核指标（限300字）：</td>
	    	<td colspan="3">
	    		<textarea name="project/tech_assign" style="width:98%" class="input_textarea required  maxlength:300" label="主要目标主要任务考核指标"   rows=5 cols=60><x:out select="$xmlData/data/project/tech_assign" /></textarea>
				<input type="hidden" name="project/tech_assign_hidden" id="project/tech_assign_hidden" value="<x:out select="$xmlData/data/project/project/tech_assign_hidden" />"/>
	    	</td>
	    </tr> --%>
	</table>
	<br/>
	<div class="t_bar">
	合作单位信息
</div>
	<table  id="tblorg_hzs" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center"  width="5%">选择</th>
						<th class="TblHead" align="center"  width="5%">序号</th>
						<th class="TblHead" align="center"  width="15%">单位名称</th>
						<th class="TblHead" align="center"  width="15%">单位地址</th>
						<th class="TblHead" align="center"  width="10%">合作单位性质</th>
						<th class="TblHead" align="center"  width="10%">合作形式</th>
						<th class="TblHead" align="center"  width="10%">合作经费支出（万元）</th> 
						<th class="TblHead" align="center"  width="15%">联系人</th>
						<th class="TblHead" align="center"  width="15%">电话</th> 
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none">
						<td align="center">
							<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_hzs" >
						</td>
						<td align="center">
							<span name="org_hzs|org_hz[0]@seq_no" >[index]</span> 
						</td>
						<td align="center">
							<input  id="org_hz_name_[0]" name="org_hzs|org_hz[0]|org_hz_name" label="单位名称" maxlength="100" value="" class=" required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="org_hz_address_[0]" name="org_hzs|org_hz[0]|org_hz_address" label="单位地址" maxlength="100" value="" class=" required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="org_hz_xz_[0]" name="org_hzs|org_hz[0]|org_hz_xz" label="合作单位性质" value="" maxlength="50" class=" required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="org_hz_xs_[0]" name="org_hzs|org_hz[0]|org_hz_xs" label="合作形式" value="" maxlength="50" class="  required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="fee_out_[0]" name="org_hzs|org_hz[0]|fee_out" label="合作经费支出" value="" onfocus="InitInput.setNumber(this,9,4,2);" class=" required input_text" style="width:80%;text-align: right;"  />
						</td>
						<td align="center">
							<input  id="lianxi_ps_[0]" name="org_hzs|org_hz[0]|lianxi_ps" label="联系人" value="" maxlength="50" class="  required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="lianxi_tel_[0]" name="org_hzs|org_hz[0]|lianxi_tel" label="电话" maxlength="30"   value="" class=" required input_text" style="width:80%"  />
						</td>
					</tr>
					
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/org_hzs/org_hz" var="org_hz">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr >
						<td align="center">
							<input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selorg_hzs" >
						</td>
						<td align="center">
							<span   name="org_hzs/org_hz[${flag}${index}]@seq_no" ><x:out select="$org_hz/@seq_no"/></span> 
						</td>
						<td align="center">
							<input  id="org_hz_name_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/org_hz_name" label="单位名称" maxlength="100" value="<x:out select="$org_hz/org_hz_name"/>" class=" required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="org_hz_address_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/org_hz_address" label="单位地址" maxlength="100" value="<x:out select="$org_hz/org_hz_address"/>" class=" required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="org_hz_xz_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/org_hz_xz" label="合作单位性质" value="<x:out select="$org_hz/org_hz_xz"/>" maxlength="50" class=" required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="org_hz_xs_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/org_hz_xs" label="合作形式" value="<x:out select="$org_hz/org_hz_xs"/>" maxlength="50" class="  required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="fee_out_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/fee_out" label="合作经费支出" value="<x:out select="$org_hz/fee_out"/>" onfocus="InitInput.setNumber(this,9,4,2);" class=" required input_text" style="width:80%;text-align: right;"  />
						</td>
						<td align="center">
							<input  id="lianxi_ps_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/lianxi_ps" label="联系人" value="<x:out select="$org_hz/lianxi_ps"/>" maxlength="50" class="  required input_text" style="width:80%"  />
						</td>
						<td align="center">
							<input  id="lianxi_tel_[${flag}${index}]" name="org_hzs/org_hz[${flag}${index}]/lianxi_tel" label="电话"  maxlength="30"   value="<x:out select="$org_hz/lianxi_tel"/>" class=" required input_text" style="width:80%"  />
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
				</tbody>
					</table>
					
					<table id="jbutton" width="98%" align="center" border="0" cellspacing="0" cellpadding="0" style="border:0;">
					<tr ><td>
					<input class="button_02" id="tianjia" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('tblorg_hzs',999,'合作单位信息最多只能填写999条')){addNewRow('tblorg_hzs');showDateTag('tblorg_hzs');}try{top.resizeFrame();}catch(e){};changeCss();getLen();">
					<input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblorg_hzs','selorg_hzs');changeCss();">
					<input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblorg_hzs','selorg_hzs');changeCss();">
					<input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblorg_hzs','合作单位信息');changeCss();getLen();">
					</td></tr>
	</table>
	
	<br/>
	<div class="t_bar"><span class="color_red">*</span>项目简述（限280字）</div>
	<table id="tblMileStones8" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
					<col style="width:34%"/>
					<col style="width:40%"/>
					<col style="width:13%"/>
					<col style="width:13%"/>
					<tr>
						<td colspan="4">
							<textarea name="project/goal" style="width:98%" class="input_textarea required  maxlength:280" label="项目简述"   rows=5 cols=60><x:out select="$xmlData/data/project/goal" /></textarea>
							<input type="hidden" name="project/goal_hidden" id="project/goal_hidden" value="<x:out select="$xmlData/data/project/project/goal_hidden" />"/>
						</td> 
					</tr> 
	</table> 
<script type="text/javascript">
$(function(){
	getLen();
});

function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
 }
 
	function changeCss(id) {
		$("#"+id+">tbody>tr:odd").each(function(){
			$(this).removeClass().addClass("li_1");
		});
		$("#"+id+">tbody>tr:even").each(function(){
			$(this).removeClass().addClass("li_2");
		});
	}
 
 function getLen() {
	var len=$("#tblorg_hzs tr:gt(1)").length;
	if(len>0){
		$("#if_have_org").val("1");
	}else{
		$("#if_have_org").val("0");
	}
}
</script>		
